/**
 * @a https://leetcode.cn/problems/jump-game/
 */

#include "../common.h"
class Solution {
public:
    bool canJump(vector<int>& nums) {
        int cur_farest = 0;
        for(int cur = 0; cur < nums.size(); ++cur){
            if(cur_farest < cur) return false;
            cur_farest = max(cur + nums[cur], cur_farest);        
        }
        return true;
    }
};